import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class test {
    public static void main(String[] args) throws ParseException {
        String dateStr = "2021-01-17 18:09:07";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date transDate = sdf.parse(dateStr);
        System.out.println(transDate);
    }
}
